/**
 *
 * @param {object} args
 */
function resNotModified(args,callback){
  let response = args.response;
  new Promise((resolve,reject)=>{
    response ? resolve() : reject();
  }).then(
      ()=>{
        response.writeHead(304);
        response.end();
        callback(null,304);
      }
      ,()=>{
        callback(new SyntaxError("response can't be undefined"),null);
      }
  ).catch((error) => {
    callback(error, null);
  })
}

module.exports = resNotModified;